//
//  CapabilityAssessmentCollectionViewCell.m
//  ZYOnlineSchool
//
//  Created by 毕武侠 on 2017/1/12.
//  Copyright © 2017年 bwx. All rights reserved.
//

#import "CapabilityAssessmentCollectionViewCell.h"
#import "CardModel.h"

@interface CapabilityAssessmentCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UIView *backView;
@property (weak, nonatomic) IBOutlet UILabel *num;

@end

@implementation CapabilityAssessmentCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.backView.layer.borderColor = RGB(180, 180, 180).CGColor;
    self.backView.layer.borderWidth = 0.8f;
    self.backView.layer.cornerRadius = 42.0f/2;//(SCREEN_WIDTH - 160.0f) / 10;
    self.backView.layer.masksToBounds = YES;
}

- (void)bindModel:(CardModel *)model {
    if (model.is_right == 2) {       //未答题
        self.backView.layer.borderWidth = 0.8f;
        self.backView.layer.borderColor = RGB(180, 180, 180).CGColor;
        self.backView.backgroundColor = [UIColor whiteColor];
        self.num.textColor = MainThemeColor;
    } else if (model.is_right == 0) {  //答错
        self.backView.layer.borderWidth = 0.0f;
        self.backView.layer.borderColor = RGB(255, 35, 68).CGColor;
        self.backView.backgroundColor = RGB(255, 35, 68);
        self.num.textColor = [UIColor whiteColor];
    } else {                    //答对/已答
        self.backView.layer.borderWidth = 0.0f;
        self.backView.layer.borderColor = MainThemeColor.CGColor;
        self.backView.backgroundColor = MainThemeColor;
        self.num.textColor = [UIColor whiteColor];
    }
    self.num.text = model.qunestion_number;
}

@end
